package co.th.bjc.md.simulation;

import java.math.BigDecimal;
import java.util.List;

import co.th.bjc.md.helper.CustomerDataHelper;
import co.th.bjc.md.model.CustomerDetails;

public class MockupCustomerData {

	public static void main(String[] args) {
		
//		new MockupCustomerData().findCustomerDetailByCustomerID();
		
//		new MockupCustomerData().findAllCustomerDetail();
		
		new MockupCustomerData().findCustomerDetailsByCriteria();
	}
	
	public void findAllCustomerDetail(){
		try {
			List<CustomerDetails> listCustomer = new CustomerDataHelper().findAllCustomerDetails();
			for(CustomerDetails customer : listCustomer){
				System.out.println("Customer Data ID : " + customer.getCustomerDataId());
				System.out.println("Customer Data Code : " + customer.getCustomerDataCode());
				System.out.println("Bed Capacity Max : " + customer.getBedCapacityMax());
				System.out.println("Bed Capacity Min : " + customer.getBedCapacityMin());
				System.out.println("Hospital Name TH : " + customer.getHospitalNameTH());
				System.out.println("Hospital Name EN : " + customer.getHospitalNameEN());
				System.out.println("Create By : " + customer.getCreateBy());
				System.out.println("Create Date : " + customer.getCreateDate());
				System.out.println("Update By : " + customer.getUpdateBy());
				System.out.println("Update Date : " + customer.getUpdateDate());
				System.out.println("------------------------------------------------------------");
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public void findCustomerDetailByCustomerID(){
		try {
			BigDecimal customer_id = new BigDecimal(1);
			
			CustomerDetails customer = new CustomerDataHelper().findCustomerDetailsByCustomerID(customer_id);
			System.out.println("Customer Data ID : " + customer.getCustomerDataId());
			System.out.println("Customer Data Code : " + customer.getCustomerDataCode());
			System.out.println("Bed Capacity Max : " + customer.getBedCapacityMax());
			System.out.println("Bed Capacity Min : " + customer.getBedCapacityMin());
			System.out.println("Hospital Name TH : " + customer.getHospitalNameTH());
			System.out.println("Hospital Name EN : " + customer.getHospitalNameEN());
			System.out.println("Create By : " + customer.getCreateBy());
			System.out.println("Create Date : " + customer.getCreateDate());
			System.out.println("Update By : " + customer.getUpdateBy());
			System.out.println("Update Date : " + customer.getUpdateDate());
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public void findCustomerDetailsByCriteria(){
		try {
			List<CustomerDetails> listCustomer = new CustomerDataHelper()
			.findCustomerDetailsByCriteria(null, null, 0, 1000, 0, 0, 0, 0, 0, 100);
			for(CustomerDetails customer : listCustomer){
				System.out.println("Customer Data ID : " + customer.getCustomerDataId());
				System.out.println("Customer Data Code : " + customer.getCustomerDataCode());
				System.out.println("Bed Capacity Max : " + customer.getBedCapacityMax());
				System.out.println("Bed Capacity Min : " + customer.getBedCapacityMin());
				System.out.println("Hospital Name TH : " + customer.getHospitalNameTH());
				System.out.println("Hospital Name EN : " + customer.getHospitalNameEN());
				System.out.println("Create By : " + customer.getCreateBy());
				System.out.println("Create Date : " + customer.getCreateDate());
				System.out.println("Update By : " + customer.getUpdateBy());
				System.out.println("Update Date : " + customer.getUpdateDate());
				System.out.println("------------------------------------------------------------");
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
